package com.xcq.mall.controller;

import com.xcq.mall.entity.Goods;
import com.xcq.mall.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author CQ.Xi
 * @since 2022-10-20
 */
@RestController
@RequestMapping("/cy")
public class GoodsController {
    @Autowired
    IGoodsService goodsService;

    @GetMapping (value = "/goods")
    public List<Goods> getGoodsListsByPage(@RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "10") Integer size, @RequestParam Integer cityId, @RequestParam Integer ip) {
        return goodsService.getGoodsListsByPage(page, size, cityId, ip);
    }

}
